<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input id="imageId" name="imageId" type="text" value="">
<img class="yzmImg fl" id="loginvalidate" src="">
<div class="yzm_flush" onclick="flushValidateImg();">看不清？请刷新！</div>
</body>
</html>
<script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
    function flushValidateImg() {
        $.ajax({
            url: '/reception/seckill/code',
            type: 'post',
            error: function () {
                alert('error')
            },
            success: function (data) {
                $('#imageId').val(data.data.imageId);
                $('#loginvalidate').attr("src", 'data:image/jpg;base64,' + data.data.imageStr);
            }
        });
    }

    $(document).ready(function () {
        flushValidateImg();
    });
</script>